Part Number Hot Search : 
W78C354 YB1509 28F800F3 S22MD2 D23C1 A0100 BCY59IX M74ALS1
Product Description
Full Text Search
 

To Download Z8FS040AHJ20EG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  z8fs040 zmotion tm detection and control family featuring zilog?s pir technology product specification ps028506-1110 preliminary copyright?2010 by zilog?, all rights reserved . www.zilog.com
zmotion tm detection and control family product specification ps028506-1110 preliminary ii warning: do not use in life support life support policy zilog's products are not authorized for use as critical components in life support devices or systems without the express prior written approval of the president and general counsel of zilog corporation. as used herein life support devices or systems are devices which (a) are intended for surgical implant into the body, or (b) support or sustain life and whose failure to perform when properly used in accordance with instructions for use provided in the labeling can be reasonably expected to result in a significant injury to the user. a critical component is any component in a life support device or system whose failure to perform can be reasonably expected to cause the failure of the life support device or system or to affect its safety or effectiveness. document disclaimer ?2010 zilog, inc., all rights reserved. information in this publication con cerning the devices, applications, or technology described is intended to suggest possible uses and may be superseded. zilog, inc. does not assume liability for or provide a representation of accuracy of the information, devices, or technology described in this document. zilog also does not assume liability for intellectual property infringement related in any manner to use of information, devices, or technology described herein or otherwise. the information contained within this document has been verified according to the general principles of electrical and mechanical engineering. z8, z8 encore!, z8 encore! xp, z8 encore! mc, ez80, zmotion, and zneo are trademarks or registered trademarks of zilog, inc. all other product or service names are the property of their respective owners.
zmotion tm detection and control family product specification ps028506-1110 preliminary iii revision history each instance in the revision history table reflects a change to this document from its previous revision. for more details, refer to the corresponding pages and appropriate links in the following table. date revision description page no. november 2010 5 updated for new zilog/ixys logo all october 2010 4 changed verbatim instances of epir to pir as appropriate. all september 2010 3 added mcu-only version. removed epir. 3, 38 august 2010 2 added zmotion product logo. i june 2010 1 original issue all
zmotion tm detection and control family product specification ps028506-1110 preliminary iv table of contents overview ...................................................................................................................... ........................... 1 features ...................................................................................................................... ........................................ 1 block diagram ................................................................................................................. ....................... 2 mcu part selection guide and reference ........................................................................................ ..... 3 pir technology revisions ...................................................................................................... ............................ 3 pin configurations ............................................................................................................ ...................... 4 overview ...................................................................................................................... ....................................... 4 signal descri ptions ........................................................................................................... .................................. 6 memory map .................................................................................................................... ....................... 9 flash memory (code spac e) ..................................................................................................... ......................... 9 ram memory map (r egister files)................................................................................................ ................... 10 peripherals.................................................................................................................... ........................ 11 peripheral av ailability ....................................................................................................... ................................. 11 adc ........................................................................................................................... ........................................ 12 timers ........................................................................................................................ ....................................... 13 watchdog timer ................................................................................................................ ................................ 13 comparator .................................................................................................................... ................................... 13 uart .......................................................................................................................... ...................................... 14 oscillator control............................................................................................................. .................................. 14 flash memory .................................................................................................................. ................................. 14 interrupt c ontroller .......................................................................................................... .................................. 14 temperature sensor ............................................................................................................ ............................. 14 low-power operatio nal amplifier ............................................................................................... ...................... 15 non-volatile da ta storage ..................................................................................................... ........................... 15 pin configur ations ............................................................................................................ ................................. 15 general-purpose input/output .................................................................................................. ........................ 15 hardware connection requirements .................................................................................................... 16 zilog?s pir technology and api ................................................................................................ ........... 17 general op eration ............................................................................................................. ............................... 17 pir engine ti mer tick ......................................................................................................... ............................. 17 pir engine entr y points ....................................................................................................... ............................ 17 pir engine cpu stack usage .................................................................................................... ...................... 18 standard api register set .................................................................................................................... 19 pir engine enable regist er (epir_enable) ...................................................................................... .............. 20 pir sensitivity register (epir_sensitivity) ................................................................................... .................... 20 pir status/control regi ster 0 (epi r_sc0) ...................................................................................... ................ 21 pir status/control regi ster 1 (epi r_sc1) ...................................................................................... ................ 23 pir status/control regi ster 2 (epi r_sc2) ...................................................................................... ................ 25 pir status/control register 3 (epir_sc3) - 28 pin ssop ........................................................................ ...... 25 pir status/control register 3 (epir_sc3) - 20 pin ssop ........................................................................ ...... 25 pir status/control register 3 (epir_sc3) - 8 pin soic ......................................................................... ........ 25 pir adc result value (epir_adc_result) ..................................................................................................... 26 pir version (epi r_version) .................................................................................................... ......................... 27 advanced api register set ..................................................................................................... ............. 28 pir advanced status/control register 0 (epir_asc0) ............................................................................ ....... 29 pir advanced status/control register 2 (epir_asc2) ............................................................................ ....... 31 pir process rate (e pir_process_rate) .......................................................................................... ............... 32 pir sample size register (epir_sample_size) .............................................................................................. 32 pir debounce time regi ster (epir_debounce) .................................................................................... ......... 32
zmotion tm detection and control family product specification ps028506-1110 preliminary v pir debounce batch size regi ster (epir_deb ounce_batch) ........................................................................ . 33 pir transient sensitivity le vel (epir_tran sient_sense) ........................................................................ ........ 33 pir noise sensitivity level (epir_noise_sense) ................................................................................ ............ 33 pir signal (e pir_si gnal) ...................................................................................................... ............................ 34 pir dc signal level (epir_signal_dc) .......................................................................................... ................ 34 packaging ..................................................................................................................... ........................ 35 ordering information .......................................................................................................... ................... 38 related documents ............................................................................................................. ................. 40 appendix a .................................................................................................................... ....................... 41 example applicati on schematics ................................................................................................ ...................... 41 appendix b .................................................................................................................... ....................... 46 pir engine initializat ion and control ......................................................................................... ....................... 46 appendix c .................................................................................................................... ....................... 49 software support files and project configuration .............................................................................. .............. 49 zds-ii projec t settings ....................................................................................................... .............................. 49 appendix d .................................................................................................................... ....................... 51 lens selectio n guide .......................................................................................................... .............................. 51
zmotion tm detection and control family product specification ps028506-1110 preliminary 1 overview zilog?s zmotion tm detection and control product family provides an integrated and flexible solution for passive infra red (pir) based motion detection app lications. the family includes a series of high- performance microcontrollers with integrated motion detection algorithms and a selection of lenses and pir sensors to fit a wide range of application requirements. optimized configuration parameters for the mcu are provided for each lens/sensor combination ensuring the best possible performance while significantly reducing development risk and minimizing time to market. the z8fs040 zmotion tm detection mcu combines the programmability and rich peripheral set of zilog?s flash z8f082a z8 encore! xp ? mcu with built-in motion detection software algorithms to provide the functions necessary for pir motion detection applications. these motion detection algorithms comprise zilog?s pir technology and run in the background while control and status of the engine is accessed through a software api (application programmer interface). this allows the designer to create their own application specific software while taking advantage of zilog?s zmotion tm motion detection technology. api settings are provided to match the engine operati on to each of the lens and pyroelectric sensor combinations provided. the flash in-circuit programming capability of the z8fs040 allows for faster development time, more flexible manufacturing and firmware changes in the field. zilog?s pir motion detection technology provides a dramatic improvement in both sensitivity and stability over traditional designs and is scalable to many market segments including lighting control, hvac, access control, vending, display, pr oximity, power management, occupancy sensing and many others. features ? high performance ez8 ? mcu core ? 4 kb in-circuit programmable flash available for application code ? single pin debug with unlimited breakpoints ? flexible clocking scheme ? internal precision oscillator running at 5.53 mhz ? external oscillator operating up to 20 mhz ? sigma delta adc ? up to 6 channels single ended or 3 channels differential available ? on-chip analog comparator with independent programmable reference voltage ? full-duplex uart with dedicated brg ? two 16-bit timers with input capture, output compare, and pwm capability (11 modes total) ? watchdog timer (wdt) with dedicated internal oscillator ? up to 20 vectored interrupts ? 6 to 25 i/o pins depending upon package
zmotion tm detection and control family product specification ps028506-1110 preliminary 2 gpio irda uart & brg timer 1 timer 0 comparator sigma/delta adc comp v ref adc v ref ez8 tm cpu flash controller register file ram (256b) + api 4kb flash memory interrupt controller por & vbo on-chip debug oscillator control on-chip peripheral power control wdt + low power oscillator 5.53mhz internal oscillator external xtal/rc oscillator register file bus program memory bus epir tm engine s/w ? 2.7 v to 3.6 v operating voltage with extended operating temperature range -40 0 c to +105 0 c ? zilog?s pir technology controlled and monitored through software api registers ? select from an assortment of lenses and pyr oelectric sensors to best fit your application ? api settings provided for each lens and pyroelectric sensor combination ? directly supports 1 or 2 pyroelectric sensors ? sensitivity control, range control and directionality detection ? extended detection modes for occupancy sensing ? low power modes block diagram figure 1 shows the architectural block diagram of the z8fs040.
zmotion tm detection and control family product specification ps028506-1110 preliminary 3 mcu part selection guide and reference table 1 displays the basic features and package styles available for each device within the z8fs040 zmotion tm mcu devices. the zmotion tm mcu is available on its own or as a package which includes the mcu, lens and pyroelectric sensor together. the part number s for the zmotion mcu are shown below. see ordering information for full zmotion tm product family part numbers. zmotion mcu part number z8 encore xp base part number flash memory gp i/o adc channels package pin configuration diagram z8fs040 x sb20eg z8f082asb020eg 4 kb 5 3 8 pin soic figure 2 z8fs040 x hh20eg z8f082ahh020eg 4 kb 16 4 20 pin ssop figure 3 z8fs040 x hj20eg z8f082ahj020eg 4 kb 22 6 28 pin ssop figure 4 where x = pir technology revision id entifier (see table 2) please refer to the base part number in product specification - ps0228 ? z8 encore! xp? f082a series product specification ? for all mcu functions, features, and specifications not covered in this document. pir technology revisions version part number engine revision identifier description 1.00 a initial release for zepir0aas01sbcg. 8-pin version only 2.00 b zmotion tm mcu series release. improved detection/stability. added range, low power, extended detection, dual pyro, advanced api features table 2 - pir technology revision identifiers table 1 - z8fs040 zmotion tm mcu series part selection guide
zmotion tm detection and control family product specification ps028506-1110 preliminary 4 pin configurations overview zilog?s z8fs040 products are available in a variety of package styles and pin configurations. this chapter describes the signals and available pin configurations for each of the package styles. for information on the physical package specifications, see packaging on page 35. figure 2, figure 3, and figure 4 display the pin configurations of all the packages available for the zmotion tm mcu series. for a description of the signals, see tables 6, 7, and 8. at reset, all port pins are set to gpio input state except /reset/de0/t1out (8 pin) which is configured to /reset, pa0/t0in/t0out/xin/dbg (8 pin) which is configured to dbg and reset/pd0 (20 and 28 pin) which are configured to /reset. figure 2 ? 8 pin soic package pin-out ? z8fs040xsb20eg figure 3 ? 20 pin ssop package pin-out ? z8fs040xhh20eg 5 1 2 3 4 6 7 8 vdd vss pa1/t0out/xout/ana3/vref/clkin ana2 pa4/rxd0/ana1/cinn pa2/reset/de0/t1out pa5/txd0/t1out/ana0/cinp pa0/t0in/t0out/xin/dbg 1 2 3 4 vdd vss pb0/ana0 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 pb1/ana1 ana2 ana3 pa0/t0in/t0out/xin pa1/t0out/xout pa2/de0 pa3/cts0 pa4/rxd0 pc3/cout pc2/ana6/led/vref pc1/ana5/cinn pc0/ana4/cinp dbg reset/pd0 pa7/t1out pa6/t1in/t1out pa5/txd0
zmotion tm detection and control family product specification ps028506-1110 preliminary 5 figure 4 ? 28 pin ssop package pin-out ? z8fs040xhj20eg 1 2 3 4 vdd vss pb0/ana0 5 6 7 8 9 10 28 27 26 25 24 23 22 21 20 19 pb1/ana1 ana2 ana3 pa0/t0in/t0out/xin pa1/t0out/xout pb4/ana7 pa3/cts0 pa4/rxd0 pc3/cout pb5/vref pc1/ana5/cinn pc0/ana4/cinp dbg reset/pd0 pa7/t1out pc6 avdd 11 12 13 14 pa2/de0 pc7 18 17 16 15 pc5 pa6/t1in/t1out pa5/txd0 avss pc2/ana6 pc4
zmotion tm detection and control family product specification ps028506-1110 preliminary 6 signal descriptions table 3 below describes the z8fs040 series signals. table 3 - signal descriptions signal mnemonic i/o description general-purpose i/o ports a?d pa[7:0] i/o port a. these pins are used for general-purpose i/o. pb[5:0] i/o these pins are used for general-purpose i/o. pc[7:0] i/o port c. these pins are used for general-purpose i/o. pd[0] i/o port d. this pin is used for general-purpose output only. uart controllers txd0 o transmit data. this signal is the transmit output from the uart and irda. rxd0 i receive data. this signal is t he receive input for the uart and irda. cts0 i clear to send. this signal is the flow control input for the uart. de o driver enable. this signal allows automatic control of external rs-485 drivers. this signal is approximat ely the inverse of the txe (transmit empty) bit in the uart status 0 register. the de signal may be used to ensure the external rs-485 driver is enabled when data is transmitted by the uart. timers t0out/t1out o timer output 0?1. these signals are outputs from the timers. t0out/t1out o timer complement output 0?1. these signals are output from the timers in pwm dual output mode. t0in/t1in i timer input 0?1. these sig nals are used as the capture, gating and counter inputs.
zmotion tm detection and control family product specification ps028506-1110 preliminary 7 table 3 - signal descriptions (continued?) comparator cinp/cinn i comparator inputs. these sign als are the positive and negative inputs to the comparator. cout o comparator output. analog ana[7:0] i analog port. these signals are used as inputs to the analog-to-digital converter (adc). vref i/o analog-to-digital converter refe rence voltage input, or buffered output for internal reference. oscillators xin i external crystal input. this is t he input pin to the crystal oscillator. a crystal can be connected between it and the xout pin to form the oscillator. in addition, this pin is used with external rc networks or external clock drivers to provide the system clock. xout o external crystal output. this pin is the output of the crystal oscillator. a crystal can be connected between it and the xin pin to form the oscillator. clock input clkin i clock input signal. this pin may be used to input a ttl-level signal to be used as the system clock. led drivers led o direct led drive capability. all port c pins have the capability to drive an led without any other external components. these pins have programmable drive strengths set by the gpio block. on-chip debugger dbg caution: i/o debug. this signal is the control and data input and output to and from the on-chip debugger. the dbg pin is open-drain and requires a pull-up resistor to ensure proper operation.
zmotion tm detection and control family product specification ps028506-1110 preliminary 8 table 3 - signal descriptions (continued?) reset reset i/o reset. generates a reset when assert ed (driven low). also serves as a reset indicator; the z8 encore! xp forces this pin low when in reset. this pin is open-drain and features an enabled internal pull-up resistor. power supply v dd i digital power supply. av dd i analog power supply. v ss i digital ground. av ss i analog ground.
zmotion tm detection and control family product specification ps028506-1110 preliminary 9 memory map flash memory (code space) the z8fs040 is based on zilog?s z8f082a device which contains a total of 8kb flash memory. zilog?s pir technology is located in the 4-kb address range from 1000h to 1fffh leaving 4 kb from 0000h to 0fffh available for user application code. zilog?s pir technology is locked and can not be erased by the user or by zilog debug interface (zdi) mass or page erase commands. figure 5 - z8fs040 program memory map 0000h 003dh 003eh 0fffh 1fffh 1000h user application code space (4033 bytes) reserved for epir engine interrupt vectors & option bits
zmotion tm detection and control family product specification ps028506-1110 preliminary 10 ram memory map (register files) there is a total of 1 kb of ram available on the base z8f082a device. some of this ram (from 080h to 0efh and 190h to 3ffh) is used by zilog?s pir technology. the remainder of the ram from 000h to 07fh and 110h to 18fh (256 bytes) is available to the application. the mcu control registers are located at the top of memory from f00h to fffh and are also available to the application. the area from 400h to effh contains no device memory. the pir motion detection api is a series of registers located in ram memory space from 0f0h to 10fh. it is through these memory locations that configuration and status are passed between the pir technology and the user application. advanced api registers are located from address 0f0h to 0ffh. see pir engine and api section for details on the api registers and setting up the project memory environment. figure 6 - z8fs040 ram memory map 000h reserved for epir engine 080h fffh 3ffh 18fh f00h 400h effh 100h 0ffh 10fh 110h mcu control registers user application ram (128 bytes) standard epir api advanced epir api 07fh 0efh 0f0h 190h reserved for epir engine user application ram (128 bytes)
zmotion tm detection and control family product specification ps028506-1110 preliminary 11 peripherals the following sections describe the differences, changes, or limitations placed on any of the z8fs040 peripherals or other functions from the base z8f082a device. for more information on the operation of each peripheral please refer to the appropriate section of ps0228. peripheral availability table 4 - peripheral availability shows how the peripherals are used by zilog?s pir technology and the differences from the base z8f082a device. the peripherals used by the pir technology should not be used by the application unless the engine is disabled through the pir engine enable register. device z8fs040xsb20eg z8fs040xhh20eg z8fs040xhj20eg base mcu device z8f082asb020eg z8f082ahh020eg z8f082ahj020eg pins/package 8 pin soic 20 pin ssop 28 pin ssop adc ana2 used for pir sensor input. ana3 is used for second sensor input in dual pyro mode. ana2 used for pir sensor input. ana3 connected to ana6/v ref . ana3 is used for second sensor input and ana6 becomes available in dual pyro mode. ana2 used for pir sensor input. ana3 connected to v ref . ana3 is used for second sensor in dual pyro mode v ref internal v ref used by the pir engine and set to 1 v. internal v ref used by the pir engine and set to 1 v. internal v ref used by the pir engine and set to 1 v. timer 0 available to application available to application available to application timer 1 available to application available to application available to application gp i/o pa3/pa1 are multiplexed with ana2/ana3 and used for pir sensor input (ana2 for single pyro mode and ana2/ana3 for dual pyro mode). pb2, pb3 & pc2 used for pir functions. in dual pyro mode pc2 becomes available. pb2, pb3 & pb5 are used for pir functions. in dual pyro mode pb5 becomes available. low power op amp not available not available not available comparator available to application available to application available to application uart available to application ? no cts available to application available to application temperature sensor not available not available not available led drive ? available to application available to application wdt available to application available to application available to application table 4 - peripheral availability
zmotion tm detection and control family product specification ps028506-1110 preliminary 12 adc zilog?s pir technology requires exclusive access to the adc peripheral in order to detect motion. however, adc conversions can be requested by the application through the api ( pir status/control register 3 ) . if it is necessary for the user application to utilize the adc peripheral directly, the pir engine must first be disabled via the pir engine enable register in the api. motion detection is not possible while the pir engine is disabled. when the user application is finished with the adc peripheral, it must re-enable the pir engine. 8 pin device: pa3 (ana2) is reserved as the analog adc input from the pyroelectric sensor. therefore ana2 is not available for user applications. additionally ana3 is used for second sensor input in dual pyro mode. all other c hannels are available to the user application. adc channel available to application 0 yes 1 yes 2 no 3 only in single pyro mode 20 pin device: pb2 (ana2) is reserved as the analog adc input from the pyroelectric sensor. therefore ana2 is not available for user applications. also, ana3 and ana6 are not available since pb3 (ana3) must be tied directly to pc2 (ana6/ v ref ). pc2 is configured as v ref output by the pir engine. in dual pyro mode ana3 is used for second sensor input ? rather than being tied to v ref and therefore ana6/ v ref becomes available. all other channels are available to the user application. adc channel available to application 0 yes 1 yes 2 no 3 no 4 yes 5 yes 6 only in dual pyro mode 28 pin device: pb2 (ana2) is reserved as the analog adc input from the pyroelectric sensor. therefore ana2 is not available for user applications. also, ana3 is not available since it is tied directly to pb5/ v ref . pb5 will be configured as v ref output by the pir engine. in dual pyro mode ana3 is used for second sensor input ? rather than being tied to v ref and therefore pb5 becomes available. all other channels ar e available to the user application. adc channel available to application 0 yes 1 yes 2 no 3 no 4 yes 5 yes 6 yes 7 yes
zmotion tm detection and control family product specification ps028506-1110 preliminary 13 timers there are two independent and identical 16 bit multi-function timers available ? timer 0 and timer 1. timer 0 this timer is available to the user application. 8 pin device: t0out not available in dual pyro mode ? configured as ana3 to support second sensor input. all other external timer 0 functions are available for the user application. 20 pin device: all external timer 0 functions are available for the user application. 28 pin device: all external timer 0 functions are available for the user application. timer 1 this timer is available to the user application. 8 pin device: t1in is configured as ana2 to support the signal input from the pyroelectric sensor and is not available to the user application. all other timer 1 functions are available. 20 pin device: all external timer 1 functions are available for the user application. 28 pin device: all external timer 1 functions are available for the user application. watchdog timer no changes or limitations are placed on these functions by zilog?s pir technology. this is available to the user application. comparator 8 pin device: the external pin that carries cout is configured as ana2 to support the signal input from the pyroelectric sensor. however, the comparator is still able to generate an interrupt internally without cout. 20 pin device: all external comparator functions ar e available for the user application. 28 pin device: all external comparator functions ar e available for the user application.
zmotion tm detection and control family product specification ps028506-1110 preliminary 14 uart 8 pin device: /cts0 is configured as ana2 to support the signal input from the pyroelectric sensor. it is therefore not available to the user application. the uart is still able to function correctly without /cts when ctse in the u0ctl0 register set to 0. 20 pin device: all external uart functions are available for the user application. 28 pin device: all external uart functions are available for the user application. oscillator control all devices can be operated with the internal 5.54 mhz ipo. for applications that require more processing power or a more accurate time base, an external crystal oscillator or ceramic resonator may be used. for the 8 pin device external oscillator support is limited to single pyro mode only since ana3 (adc input for second pyro sensor) is multiplexed with xout. the 20 and 28 pin devices can be operated with an external oscillator in both single and dual pyro modes. do not operate at frequencies lower than the ipo frequency while the pir engine is enabled or motion detection performance will be degraded. no other changes or limitations are placed on these functions by the pir engine. flash memory the control registers associated with the flash memory are all available to the application. zilog?s pir technolgoy uses the value programmed into the flash frequency registers (ffreq) to determine its required sample timing. this register must be programmed prior to initializing the pir engine. the flash frequency high (ffreqh) and flash frequency low byte (ffreql) registers combine to form a 16-bit value ffreq. this value is also used by the pir engine to calculate the required sample rate of the adc and other functions. the 16- bit value for ffreq is the system clock frequency in khz and is calculated using the following equation. ffreq[15:0] ? = ? {ffreqh[7:0],ffreql[7:0]} ? = ? (system ? clock ? frequency)/1000 ? interrupt controller no changes or limitations are placed on the interrupt controller functions by zilog?s pir technology. temperature sensor the temperature sensor is not tested or calibrated (trim bits are not available). therefore this peripheral is not available on any of the z8fs040 devices.
zmotion tm detection and control family product specification ps028506-1110 preliminary 15 low-power operational amplifier the ampinp signal is multiplexed with ana2 which is used for the pyro sensor input. therefore this peripheral is not av ailable on any of the z8fs040 devices. non-volatile data storage there is no dedicated non-volatile data storage on the z8fs040 devices. pin configurations although most pins on the zmotion tm mcu series are available to the application, some pins are dedicated to supporting the pir functions. the following section describes which pins are reserved and which are available to the application. the pins used by zilog?s pir technology are automatically configured when the engine is initialized. general-purpose input/output all of the general purpose i/o?s are available exc ept for those used for the pir circuit. see example application schematics, appendix a for more information. 8 pin device: pin 5 (ana2) is reserved as the analog adc input from the pyroelectric sensor. any other functions multiplexed with pin 5 (pa3//cts0, cout and t1in) are not available for user applications. in dual pyro mode (application uses 2 pyroelectric sensors) pin 3 (ana3) is used as an analog adc input for second sensor and is therefore not available for other functions (t0out/vref/clkin). 20 pin device: pin 2 (ana2) is reserved as the analog adc input from the pyroelectric sensor. in single pyro mode, pin 3 (ana3) must be externally tied to v ref on pin 18 (pc2/ana6/led/ v ref ). pc2 will be configured as the v ref output by the pir engine when it is enabled. in dual pyro mode (supporting 2 pyroelectric s ensors), pin 3 (ana3) is used for the second sensor. in this mode the pin 18 v ref signal is not connected externally to any other adc inputs and is therefore available to the application (pc2/ana6/led/ v ref ). 28 pin device: pin 1 (ana2) is reserved as the analog adc input from the pyroelectric sensor. in single pyro mode, pin 4 (ana3) must be externally tied to v ref on pin 3 (pb5/ v ref ). pb5 will be configured as v ref output by the pir engine when it is enabled. in dual pyro mode (supporting 2 pyroelectric sensors), pin 4 (ana3) is used for second sensor. in this mode the pin 3 v ref signal is not connected externally to any other adc inputs and is therefore available to the application (pb5/ v ref ).
zmotion tm detection and control family product specification ps028506-1110 preliminary 16 hardware connection requirements this section describes the required external hardware connection for the zmotion tm mcu series. pins are automatically configured to their required function when the pir engine is initialized via the epir_init macro. see appendix a for example schematic diagrams showing the required connections. the device can be operated in single pyro mode suppor ting one pyroelectric sensor or dual pyro mode supporting two pyroelectric sensors. both of these modes can be operated in normal or low scan rate modes. depending on the application, there can be up to 3 connection requirements supporting these modes: 1. pyroelectric sensor (pir sensor) the signal from the pir sensor is connected directly to the ana2 input of the adc. the adc is configured for differential, buffered mode by zilog?s pir technology. the sensor signal should be connected directly to the adc input with no additional signal conditioning circuitry unless specified by the pyroelectric sensor manufacturer. 2. adc v ref the on chip v ref is configured for 1v nominal. the pir sensor signal is connected to the ?+? differential input of the adc (ana2) and the v ref signal is connected to the ?-? differential input (ana3). the 8 pin device has an internal connection from v ref to ana3 to support this configuration therefore no external hardware connection is required. the 20 and 28 pin devices require an external connection from the v ref out signal to the adc ?-? (ana3) input. 3. pyroelectric passive infrared sensor #2 in dual pyro mode, the adc is still used in di fferential, buffered mode (same as single pyro mode). the signal from the second pir sensor is connected to ana3. the v ref signal is no longer connected to ana3 (?-? adc input). the fist pir sensor is connected to the ?+? adc input (ana2) as it is in single pyro mode. the v ref signal is still used internally for the adc, but the external pin is unused in dual pyro mode.
zmotion tm detection and control family product specification ps028506-1110 preliminary 17 zilog?s pir technology and api general operation the zmotion tm mcu series is based on the z8 encore! xp ? z8f082a mcu with the added functionality of a motion detection engine (pir engine). the pir engine is located in the upper 4kb area of the 8kb device leaving 4kb of code space to the user application. it operates in the background and is controlled and monitored through an application programmer interface (api). the api is a series of reserved registers in memory. there are two sections to the api ? standard api registers and advanced api registers: 1. standard api registers : it includes all of the status and control functions needs for most applications. these include sensitivity control, motion detection/direction status and operational modes. 2. advanced api registers : it provides additional control over the pir engine operation and allows it to be configured to support the pyroelectric sensor and lens being used in the application. pir engine timer tick bit 7 of pir status/control register 1 provides a 1 second time base for the pir engine to perform house keeping operations. this bit must be set to 1, once per second by the user application. the bit is checked and cleared during the epir_adc_isr routine. pir engine entry points there are two entry points to the pir engine that are accessed through two predefined macros. one is an initialization macro that is used to start the engine and the other is executed upon every adc interrupt. both macros save and initialize the register pointer, perform a call to the pir engine entry point and then restore the register pointer before returning control to the application. it is the responsibility of the application s/w to execute these macro?s at the appropriate time. epir_init macro this macro is executed to initialize the pir engine after reset. it is normally only executed once and is used in conjunction with the pir engine enable register in the standard api section. the application should initialize all api registers, write the pir enable pattern to the pir engine enable register, and then execute this macro. adc conversions are started by this macro. epir_init macro: pushx rp ldx rp, #%e0 call %1ffd popx rp cpu cycles: 261 peripherals initialized: adc and gpio depending on api selected optio ns. adc irq set for medium priority.
zmotion tm detection and control family product specification ps028506-1110 preliminary 18 epir_adc_isr macro this macro is executed for each adc conversion. the application handles the adc interrupt and executes this macro. all motion detection processing is performed by this macro. epir_adc_isr macro: pushx rp ldx rp, #%e0 call %1000 popx rp the cpu cycles used by this macro vary depending on engine state and configuration. pir engine cpu stack usage the pir engine shares the processor stack with the user application. there are no special requirements on the placement of the stack in memory, but it is essential that the user provide enough stack space for both the user application and the pir engine. the pir engine requires maximum 6 bytes of stack.
zmotion tm detection and control family product specification ps028506-1110 preliminary 19 standard api register set the standard api register set is a series of registers implemented in the z8fs040 ram that allows the user code to configure and communicate with the pir engine. the default values are loaded only when the pir engine is enabled via the pir enable register. api register name address mnemonic description pir engine enable register 100h epir_enable enable pir engine pir sensitivity register 101h epir_sensitivity motion sensitivity pir status/control register 0 102h epir_sc0 motion status and engine mode control pir status/control register 1 103h epir_sc1 engine status and control pir status/control register 2 104h epir_sc2 range control pir status/control register 3 105h epir_sc3 adc scan request pir adc result value 10ah/10bh epir_adc_result adc scan result pir version 10ch epir_version pir engine software version table 5 - pir engine standard api registers
zmotion tm detection and control family product specification ps028506-1110 preliminary 20 pir engine enable register (epir_enable) bit 7 6 5 4 3 2 1 0 field pir enable/disable pattern control read/write address 100h pir enable/disable pattern (bits 0-7) pir enable/disable register controlled by application the pir enable register controls the overall operation of the pir engine. as an added level of protection, there is a specific 8 bit enable value and 8 bit disable value. all other values are reserved. reading this register returns the last value writt en. once enabled, the pir engine reads the application controlled status/control register values and sets the engine controlled values to their default state. to enable the pir engine, first write the epir_en able_pattern to the pir enable register then execute the epir_init macro. pattern name description 00h epir_disable_pattern disables all engine functions, including motion detection. used to temporarily or permanently shut down the engine. 11h epir_enable_pattern enables the pir engine. all primary engine functions as configured in engine status/c ontrol registers are enabled. confirmation of enabled status is provided through engine disabled bit in status/control register 0. table 6 - pir software enable patterns pir sensitivity register (epir_sensitivity) bit 7 6 5 4 3 2 1 0 field sensitivity default u u u u u u u u control read/write address 101h sensitivity (bits 0-7) pir sensitivity setting controlled by application the pir sensitivity register is used to adjust the se nsitivity of the pir engine to target motion. lower values produce higher sensitivity to motion with 00h being the most sensitive and ffh being the least sensitive. the user application should load this regist er with the appropriate value to give the desired sensitivity. notes: ? the setting of this register also affects the ra nge of detection. lower values increase range and higher values decrease range. ? depending on the lens and pyroelectric sensor us ed, values above 3fh may result in very limited detection.
zmotion tm detection and control family product specification ps028506-1110 preliminary 21 pir status/control register 0 (epir_sc0) bit 7 6 5 4 3 2 1 0 field extended detection engine disabled md suspend motion direction control motion direction motion detected pir stable control r/w r r/w r/w r r/w r address 102h extended detection level (bit 6-7) sets the sensitivity le vel of extended detector controlled by application these 2 bits enhance the motion detection algorithms to detect slower, faster and/or more subtle motion. the extended detection level is selected to provide a balance between additional sensitivity while maintaining stability (no false detections). in certain applications such as lighting control the extended detection level can be increased once ?normal? motion has been detected. extended detection is dependent on the lens pattern used. smaller lens beams tend to provide more subtle motion detection. the extended detection level effects user contro l over the range provided in epir_sc2. as the extended detection level is increased, t he range setting becomes less effective. 00 = extended detection level 0 ? minimum (least sensitive) 01 = extended detection level 1 10 = extended detection level 2 11 = extended detection level 3 ? high (most sensitive) engine disabled (bit 5) pir engine disable/suspend acknowledged controlled by pir engine this bit indicates the operational status of and is controlled by the pir engine. when the engine is initialized and enabled by loading the pir enable register with the epir_enable_pattern value, this bit is cleared to indicate that the engine is ready. when the engine is disabled by loading the pir enable register with the epir_di sable_pattern, it will respond by se tting this bit to 1 and perform no further operations until re-enabled. in order for th e engine to detect that it has been disabled, the user must allow the engine adc interrupt to run at least once after loading the pir enable register with the epir_disable_pattern. 0 = engine is enabled and operational 1 = engine is disabled and not operational
zmotion tm detection and control family product specification ps028506-1110 preliminary 22 md suspend (bit 4) motion detection suspend controlled by application temporarily suspends the pir engine from running. this puts it in a very low processing overhead state and can be used when the application requires signifi cant cpu processing power. while suspended, motion detection is disabled, however to ensure fast recovery from this mode, adc interrupts still occur and samples continue to be buffered. when the application clears this bit, suspend mode is exited upon the next adc interrupt. 0 = normal motion detection 1 = suspended motion detection motion direction control (bit 3) motion direction control enable controlled by application this bit enables directional motion detection. the relati ve direction of the detected motion is indicated in bit 2 (motion direction) of this same register. when configured as a directional detector (bit 3 set to 1), direction is indicated in bit 2 as positive or negative relative to the pir sensor. 0 = standard motion detection mode. motion detected in any direction. motion direction status bit (bit 2) is not valid. 1 = directional motion detection mode. motion is detected in any direction; relative direction is indicated via motion direction status bit (bit 2). the directional polarity of pir sensors is arbitrary at the time of manufacturing. therefore it is necessary for the user application to calibrate to each individ ual pir sensor using a controlled target (i.e. moving in a known direction) and internally record the polarity to identify which polarity represents that direction. motion direction (bit 2) relative direction of last motion detected controlled by pir engine when directional motion detection is enabled, this bi t indicates the relative direction of the last motion detected. when the pir engine sets the motion detected bi t in pir status register 0, this bit is set or cleared to indicate the direction of the motion. t he status is latched until the user application clears the motion detected bit. 0 = last detected motion was negative 1 = last detected motion was positive this status bit is undefined when motion direction control is disabled. motion detected (bit 1) motion detected on pir sensor set by pir engine; cleared by application this bit indicates that the engine has detected a motion event. the user application should routinely check this bit to determine if motion has been dete cted. this bit is set by the engine and must be cleared by the user application. 0 = no motion detected by the engine 1 = motion has been detected by the engine
zmotion tm detection and control family product specification ps028506-1110 preliminary 23 pir stable (bit 0) passive infrared (pir) sens or signal stabilized bit controlled by pir engine after periods of non-use the pir sensor will take some time to stabilize before it can be used reliably. the amount of time is dependant on the pir sensor being used and environmental conditions and can range from a few seconds up to a minute. to relie ve the application s/w from having to assume the worst case stabilization time, the pir engine automatica lly monitors the dc offset of the pir sensor and sets this bit when it determines that it has become stable. this bit indicates that the pir sensor has stabilized after one of the following conditions: - after initial power on (cold start). - after re-enabling the engine via pir enable register. - after returning from sleep mode. 0 = pir sensor signal is not stable, motion detected events are not valid 1 = pir sensor signal is stable, motion detected events are valid pir status/control register 1 (epir_sc1) bit 7 6 5 4 3 2 1 0 field engine timer tick frequency response pir scan rate reserved dual pyro enable control r/w read/write r/w 0 r/w address 103h engine timer tick (bit 7) pir one second timer tick set by application; cleared by pir engine this bit must be set to 1 once per second by the user application. this provides the engine with a one- second tick to perform house keeping operations relating to the motion detection. the engine will routinely poll this bit to obtain a one-second tick. this bit is cleared by the engine. 0 = cleared by pir engine 1 = one-second interval has occurred frequency response (bits 3-6) frequency response of pir engine controlled by application range: 0h - ch this value determines the frequency response of the motion detection system. higher values allow lower frequencies to be accepted by the pir engine. lower values cause the engine to ignore targets that generate lower frequencies. thes e targets typically include horizontally oriented objects such as pets. the frequency of the signal that is presented to t he pir engine is largely dependent on the structure of the pir lens being used (number and dispersion of beams). a lens with several evenly distributed beams provides better frequency response performa nce than a lens with an uneven beam distribution. note: lower programmed values also have the effect of reducing the relative range of detection.
zmotion tm detection and control family product specification ps028506-1110 preliminary 24 pir scan rate (bit 2) pir adc conversion rate for the pyroelectric sensor controlled by application the pir engine performs the necessar y adc conversions on the pir sensor input. each conversion generates an interrupt that is processed by the pir engine from the epir_adc_isr macro. the pir scan rate bit determines the rate at wh ich the adc conversi ons are generated. in normal scan rate mode (pir scan rate set to 0), the z8fs 040 adc peripheral is set to continuous conversion mode which causes a conversion to be carri ed out automatically every 256 system clocks. in this mode, the application is only required to ex ecute the epir_adc_isr macr o for each adc interrupt. the adc continually runs and continuously generates interrupts. when low scan rate mode is selected by setting this bit to a 1, continuous conversion mode is disabled and the adc is operated in single-shot m ode such that each conversion takes 5129 system clocks to complete. in this mode, the application s/ w must initiate the adc conversion request (set bit 7 of adcctl0) and execute the epir_ adc_isr macro once every 5ms. in low scan rate mode, the adc is disabled betw een conversions to reduce power consumption. power consumption can be reduced further if the applic ation s/w uses this mode in conjunction with the cpu?s halt or stop modes. alternately, this mode can be used to provide the application s/w with additional cpu processing time. although the low scan rate mode provides the appl ication with more processing power and the opportunity for the system to reduce power cons umption, the normal scan rate will provide better sensitivity and range. while operating in low scan ra te mode, sensitivity is reduced by approximately 20%. the performance of direction detection may al so be reduced in this mode. emc immunity is disabled while in low scan rate mode. if the pir scan rate bit is changed during engine oper ation, the engine will stop detecting motion for up to 200ms to avoid potential false motion detection. when changing the pir scan rate mode, the advanced api registers must first be updated with the appropriate values. 0 = normal scan rate mode 1 = low scan rate mode dual pyro mode (bit 0) dual pyroelectric sensor signaling mode controlled by application this bit determines if the pir engine should accept signals from one or two pyroelectric sensors. when configured for single pyro operation, only one sensor is used (connected to ana2). when configured for dual pyro operation, the engine will scan two sensor s simultaneously. dual pyro mode is typically used to provide a larger area of coverage. the second py roelectric sensor is conn ected to input ana3. in dual pyro mode, motion on either sens or will generate a motion detected event. 0 = single pyroelectric sensor mode 1 = dual pyroelectric sensor mode
zmotion tm detection and control family product specification ps028506-1110 preliminary 25 pir status/control register 2 (epir_sc2) bit 7 6 5 4 3 2 1 0 field reserved range control control 0 read/write address 104h range control (bits 0-2) motion detection range control controlled by application these bits determine the relative range of motion detection. larger values decrease the range of detection. typical values used for range are dependant on the lens and pyroelectric sensor being used. range is also dependent on target size, speed, and re lative temperature. for example, a range control setting that rejects one target of a particular size at a given distance does not guarantee that a larger target will be rejected at the same distance. pir status/control register 3 (epir_sc3) - 28 pin ssop bit 7 6 5 4 3 2 1 0 field ana7 scan request ana6 scan request ana5 scan request ana4 scan request reserved reserved ana1 scan request ana0 scan request control r/w r/w r/w r/w 0 0 r/w r/w address 105h pir status/control register 3 (epir_sc3) - 20 pin ssop bit 7 6 5 4 3 2 1 0 field reserved ana6 scan request ana5 scan request ana4 scan request reserved reserved ana1 scan request ana0 scan request control 0 r/w reserved in single pyro mode r/w r/w 0 0 r/w r/w address 105h pir status/control register 3 (epir_sc3) - 8 pin soic bit 7 6 5 4 3 2 1 0 field reserved reserved reserved reserved ana3 scan request reserved ana1 scan request ana0 scan request control 0 0 0 0 r/w reserved in dual pyro mode 0 r/w r/w address 105h
zmotion tm detection and control family product specification ps028506-1110 preliminary 26 anax scan request analog channel 0, 1, 3-7 scan requested bits set by application; cleared by pir engine these bits allow the user application to request the engine to perform an a/d conversion on the non- reserved analog inputs. when requested, the engine w ill reconfigure the appropriate i/o pin to a single- ended, unbuffered input using a 2 volt reference. it w ill then take the next sample and store it in the pir adc result value registers and clear all anax scan request bits. the i/o configuration for the anax pin is not returned to its previous configuration by the engine. if needed, the user application must do this. if multiple request bits are se t simultaneously, the engine will onl y scan the lowest numbered adc channel requested and ignore any other requests. the user application should set one request bit then poll it to determine when the conversion is complete and the data is ready. when adc scan requests are being serviced by the pir engine, adc conversions on the pir sensor are suspended. therefore the user application should be careful not to continuously request adc scan?s. the process rate register in the ?advan ced pir engine? section can be monitored to ensure the engine is receiving enough time to perform its required pir sensor adc scans. 0 = no conversion requested/ last conversion completed 1 = perform a conversion on this channel pir adc result value (epir_adc_result) bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 field adc result value control read address 10ah 10bh pir adc result value (bits 0-15) adc scan request result value controlled by pir engine the pir adc result value contains the result of the last application requested adc conversion. the data format is identical to that given in t he z8 encore xp product specification (ps0228) for registers adcd_h and adcd_l. example for requesting an ana0 conversion: o set bit 0 (ana0 scan request) in pir status/control register 3 (epir_sc3) o wait until the ana0 scan request bit is cleared by the engine o read the adc conversion result from the pir adc result value register note: even though the adc result value is a 16 bit r egister, atomic operations are not required since the value is only updated at t he request of the application.
zmotion tm detection and control family product specification ps028506-1110 preliminary 27 pir version (epir_version) bit 7 6 5 4 3 2 1 0 field version control read address 10ch version (bits 0-7) pir engine software version controlled by pir engine the value stored in this register indicates the software version of the pir engine. value pir engine software version 03h 2.00
zmotion tm detection and control family product specification ps028506-1110 preliminary 28 advanced api register set the following registers are for advanced configuration of the pir engine. they include customization for lens and pyroelectric sensor configurations. these registers are not initialized by the pir engine. api advanced register name address mnemonic description pir advanced status/control register 0 f0h epir_asc0 em noise and md origin status pir advanced status/control register 2 f2h epir_asc2 window size, lock level, and window update rate pir process rate f3h/f4h epir_process_rate relative processing available to pir engine pir sample size register f5h epir_sample_size controls amount of sensor signal averaging pir debounce time register f6h epir_debounce_time controls time to debounce motion signal pir debounce batch size register f7h epir_debounce_batch controls out of window samples needed for debounce pir transient sensitivity level f8h epir_transient_sense sets pir engine sensitivity to transient detection pir noise sensitivity level f9h epir_noise_sense sets pir engine sensitivity to noise detection pir signal fah/fbh epir_signal current pyro sensor signal sample pir pyro dc signal level fch/fdh epir_signal_dc current calculated pyro sensor dc offset table 7 - pir engine advanced registers
zmotion tm detection and control family product specification ps028506-1110 preliminary 29 pir advanced status/control register 0 (epir_asc0) bit 7 6 5 4 3 2 1 0 field reserved reserved reserved buffer refresh new sample md origin em noise detected em transient detected control 0 0 0 r/w r/w r r/w r/w address f0h buffer refresh (bit 4) uses fast fill algorithm to quickly refill the motion detection buffers. controlled by application this bit is used to re start motion detection by quickly reinit ializing and refilling the motion detection constructed sample buffers. this can be used as a method to restore motion detection after waking up from sleep mode or it can be used to help ignore external events that may cause false detections. waking up from sleep mode: if this bit is set when the epir_init macro is execut ed the engine re-fills the constructed sample buffers with a fast fill algorithm that allows it to quickly restore motion detection. typically, a simple external wake-up circuit would be implemented that provid es an unqualified motion detection signal to wake up the mcu from sleep mode (smr). upon smr, the app lication would set the buffer refresh bit, execute epir_init, and then continue with normal motion detection functions for some period of time before returning to sleep mode. by setting this bit prior to epir_init, the engine buffers are filled much faster enabling it to analyze the original signal seen by the ex ternal wake up circuit and determine if it is ?real? motion. ignoring false detection events: if the mcu is used to control external components (l ed?s, relays, lights, triac?s, etc) a fluctuation on the power supply can be created as the external devic e is turned on or off. the buffer refresh bit can be used to ignore any false detection that could be created by these fluctuat ions. when the external device is turned on or off, the application can set the buffer refresh bit to effectively reset the motion detection history and therefore ignore any effect from the external device. new sample (bit 3) new sample available from pir signal high/low register set by pir engine, cleared by application this bit indicates that the pir engine has a new sens or signal input sample available that may be read by the application. this status is available as an advanced feature as the application is not normally required to read the sampled pir sensor signal. the application must clear this bit when the sample has been read.
zmotion tm detection and control family product specification ps028506-1110 preliminary 30 md origin (bit 2) origin of last motion detection event controlled by pir engine this bit indicates how the pir engine detected the last motion detected event. when the engine sets the motion detected bit in pirstatus0, it also sets th is bit according to which detection engine registered the event. 0 ? normal motion detector 1 ? extended motion detector em noise detected (bit 1) em noise detected on pir signal set by pir engine; cleared by application this bit indicates if the engine has detected noise on t he pir signal. this event is provided to the user application to indicate that an em noise event has occurred and associated motion event(s) may have been suppressed by the engine. this bit does not have to be read for normal operation and is provided as status only. the application must clear this bit after it has been read. em transient detected (bit 0) em transient detected on pir signal set by pir engine; cleared by application this bit indicates if the engine has detected a transi ent on the pir signal. this event is provided to the user application to indicate that an em transient event has occurred and associated motion event(s) may have been suppressed by the engine. this bit d oes not have to be read for normal operation and is provided as status only. the application must clear this bit after it has been read.
zmotion tm detection and control family product specification ps028506-1110 preliminary 31 pir advanced status/control register 2 (epir_asc2) bit 7 6 5 4 3 2 1 0 field lock level window size window update rate control r/w r/w r/w address f2h lock level (bits 5-7) controlled by application this parameter sets the minimum slope change in the signal that can be considered valid motion. this prevents small signal changes caused by environmental or vcc shifts from causing a false detection. use this value in combination with pir sensitivit y and range control settings to balance sensitivity and stability to the particular lens and pyroelectric sensor being used. ? smaller values allow subtle signals with lower slopes to be considered motion events at the expense of potential false motion events. ? larger values allow the system to ignore sm aller signal slope changes at the expense of potentially missing smaller motion events. window size (bits 3-4) controlled by application this register determines the size of the control limit window. a larger window size produces more stable control limits at the cost of additional cpu usage. if a smaller window size is used, the more frequently the window can be calculated which allo ws it to track the signal better. 00 ? reserved 01 ? small window 02 ? medium window 03 ? large window window update rate (bits 0-2) controlled by application this register determines how frequently the control lim its are calculated. it is measured in pir samples. a smaller number produces more frequent calculations which allow the control lim its to track the signal better, at the cost of increased cpu usage. the valid range is 0 to 7. the window is updated every 4 + (window update rate * 2) pir samples.
zmotion tm detection and control family product specification ps028506-1110 preliminary 32 pir process rate (epir_process_rate) bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 field pir process rate control read address f3h f4h pir process rate (bits 0-7) controlled by pir engine the pir process rate indicator is provided by the engine to determi ne if the user application process and interrupts overhead is impacting the performance of the engine. if the engine process rate drops significantly, its ability to detect motion can be significant ly reduced. this value is typically used at the application development stage. this number gives an indication of how much cpu time the engine is receiving. higher numbers are better. generally, if the process rate drops below 0080h, the ability to detect motion could be compromised. note: the 16 bit value provided by these two 8 bit regi sters must be read as an atomic operation by the application. this can be ensured by either using the cpu?s atm instruction or by disabling interrupts while reading the two 8 bit registers. pir sample size register (epir_sample_size) bit 7 6 5 4 3 2 1 0 field pir sample size control read/write address f5h pir sample size (bits 0-7) controlled by application this register controls the amount of averaging that the engine performs on the incoming pir signal adc samples. more averaging improves signal noise im munity at the cost of a slower sample rate. pir debounce time regi ster (epir_debounce) bit 7 6 5 4 3 2 1 0 field pir debounce time control read/write address f6h pir debounce time (bits 0-7) controlled by application this register controls the amount of time that the engine will wait to fully debounce a motion signal. longer times result in detection of subtle motion at the cost of more potential false motion detections. valid range is from 01h to ffh.
zmotion tm detection and control family product specification ps028506-1110 preliminary 33 using a value less than the value in the pir sensit ivity register will result in no motion detection. pir debounce batch size regi ster (epir_debounce_batch) bit 7 6 5 4 3 2 1 0 field pir debounce batch size control read/write address f7h debounce batch size (bits 0-7) controlled by application this register determines the number of consecutive out-of-wi ndow samples required in order to consider the sequence a valid debounce count. the field works as a mask. increasing the mask size (i.e. more bits set to 1) will increase the noise immunity of t he engine but result in lower sensitivity to subtle motion signals. valid values are 01h, 03h, 07h, 0fh, 1fh, 3fh, 7fh, and ffh. pir transient sensitivity l evel (epir_transient_sense) bit 7 6 5 4 3 2 1 0 field reserved pir transient sensitivity control 0 read/write address f8h transient sensitivity (bits 0-6) controlled by application this register determines how sensit ive the transient detection part of the engine is to sudden changes in the pir signal. a lower number makes the engine more sensitive, at the cost of potential rejection of large signal motion (ex. warm ta rget very close to detector). the valid range is 0 (disabled) to 64h. pir noise sensitivity l evel (epir_noise_sense) bit 7 6 5 4 3 2 1 0 field reserved pir noise sensitivity control 0 read/write address f9h noise sensitivity (bits 0-6) controlled by application this register determines how sensit ive the noise detection part of the engine is to random noise in the pir signal. a lower number makes the noise detector more sensitive, at the cost of potential rejection of small-signal motion (ex. small delta between ambient and target temperature or distant target). the valid range is 0 (disabled) to a maximum value determined by the window size selected in the pir advanced status/control register 2. window size max pir noise sensitivity value typical value small 0ch 08h
zmotion tm detection and control family product specification ps028506-1110 preliminary 34 medium 1dh 12h large 46h 2d pir signal (epir_signal) bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 field pir signal control read address fah fbh pir signal (bits 0-15) controlled by pir engine these registers contain the last pir signal obtained by the engine. each time the engine generates a new pir signal sample it will place it in these regi sters and set the new sample bit in the pir advanced status/control 0 register. this gives the application direct visibility to the pir generated signal for debugging purposes. note: the 16 bit value provided by these two 8 bit regi sters must be read as an atomic operation by the application. this can be ensured by either using the cpu?s atm instruction or by disabling interrupts while reading the two 8 bit registers. pir dc signal level (epir_signal_dc) bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 field pir signal dc control read address fch fdh pir signal dc level (bits 0-15) controlled by pir engine these registers contain the last pir signal dc level calculated by the engine. each time the engine generates new control limits it will place t he dc component level in these registers. note: the 16 bit value provided by these two 8 bit regi sters must be read as an atomic operation by the application. this can be ensured by either using the cpu?s atm instruction or by disabling interrupts while reading the two 8 bit registers.
zmotion tm detection and control family product specification ps028506-1110 preliminary 35 packaging figure 7 - 8-pin small outline in tegrated circuit package (soic)
zmotion tm detection and control family product specification ps028506-1110 preliminary 36 figure 8 - 20-pin small shrink outline package (ssop)
zmotion tm detection and control family product specification ps028506-1110 preliminary 37 figure 9 - 28-pin small shrink outline package (ssop)
zmotion tm detection and control family product specification ps028506-1110 preliminary 38 ordering information the zmotion tm detection and control family comprises the zmotion tm mcu, lens and pyroelectric sensor. construct your part number bas ed on the specific combination of mcu, lens and pir sensor you wish to order. there are four fields in the part number that determine this combination. order the zmotion tm detection and control product from zilog ? using the following table. position: 1 2 3 4 5 6 7 8 9 10 11 12 13 field z m o t mcu mcu package lens pir g selected options position 1 - 4: zmot - zmotion tm product family to purchase the zmotion tm mcu alone, use the zmotion mcu part number in the following table. position 5, 6 & 7, 8 - mcu and mcu package selector: mcu part number description pir software revision mcu field (pos 5, 6) mcu package field (pos 7, 8) z8fs040xsb20eg occupancy, 8 pin soic 2.00 0b sb z8fs040xhh20eg occupancy, 20 pin ssop 2.00 0b hh z8fs040xhj20eg occupancy, 28 pin ssop 2.00 0b hj note: the second digit of the mcu field refers to the pir software engine revision position 9, 10 & 11, 12 - lens and pir sensor selector: manufacturer part number description lens field (pos 9, 10) pir sensor pir field (pos 11, 12) fresnel technologies aa 0.9 gi t1 animal alley array (88 o ) 0a re200b-p 0a sda02-54-p 0b fresnel technologies cm 0.77 gi v3 ceiling mount array (360 o ) 0b re200b-p 0a sbdi46-504aa 0c fresnel technologies cm 0.77 gi v5 ceiling mount array (360 o ) 0c re200b-p 0a sbdi46-504aa 0c fresnel technologies cwm 0.5 gi v1 ceiling/wall mount array (360 o ) 0d re200b-p 0a sbdi46-504aa 0c nicera ncl-9(26) clip-on 15mm array (360 o ) 1a re200b-p 0a sbdi46-504aa 0c
zmotion tm detection and control family product specification ps028506-1110 preliminary 39 position 13 ? environmental ?g? = rohs compliant pir sensor information: manufacturer part number description nicera re200b-p basic dual element nicera sda02-54-p premium dual element nicera sbdi46-504aa quad element refer to product specification ps0286 for details on the lens and pyroelectric sensors. ordering example: part number: zmot0bsb0a0bg for more information on ordering, please consult your local zilog sales office. the zilog website ( www.zilog.com ) lists all regional offices and provides additional product information. g b 0 a 0 b s b 0 t o m z example g pir lens ic pkg ic t o m z field 13 12 11 10 9 8 7 6 5 4 3 2 1 pos #: rohs pir sensor (sda02-54-p) lens (aa 0.9 gi t1) ic package (8 pin, soic) ic (occupancy, s/w version 2.00) zmotion product family
zmotion tm detection and control family product specification ps028506-1110 preliminary 40 related documents additional information can be found in the followi ng documents. these are available from the zilog website ( www.zilog.com ). document number description ps0286 zmotion tm lens and pyroelectric sensor product specification pb0225 zmotion tm detection and control product brief ps0228 z8 encore! xp ? f082a series product specification pb0223 zmotion tm detection module product brief ps0284 zmotion tm detection module product specification wp0017 a new pir motion detection architecture white paper
zmotion tm detection and control family product specification ps028506-1110 preliminary 41 appendix a example application schematics z8fs040xsb20eg - (8 pin) figure 10 shows an example circuit for t he 8 pin device of the zmotion tm detection and control mcu family. the interface to the pyroelectric sensor is via the dedicated input ana2 (pin 5). the status led is driven by pin 6 which is normally configured as a gpio by the application to control the state of the led. pin 2 is used as the debug input to the chip, but can be used for other functions as required. pin 4 is set up for the reset function, but may also be used for other functions as the application requires. pull-up resistors (10k) are provided on the debug and reset signals as required for the debug interface. the signals on pins 3 and 7 can be used as needed. the power supply design is left to the application needs. in dual pyro mode, the second pyroelectric s ensor is connected to pin 3 (ana3). all other connections remain the same. vdd pa1/t0out/xout/ana3/vref/clkin pa0/t0in/t0out/xin//dbg pa2/reset/de0/t1out vss ana2 pa4/rxd0/ana1/cinn pa5/txd0/t1out/ana0/cinp z8fs040xsb20eg 1 2 3 4 8 7 6 5 vdd (3.3v) 1uf 1uf 1 2 3 4 5 6 vcc reset gnd dbg gnd nc 47k 10k 10k debug header pyro electric sensor vdd gnd sig 470 status led vdd (3.3v) to second pyro electric sensor in dual pyro mode figure 10 - required circuit connections of z8fs040xsb20eg (8 pin) motion detection mcu
zmotion tm detection and control family product specification ps028506-1110 preliminary 42 z8fs040xhh20eg - (20 pin) single pyroelectric sensor figure 11 shows an example circuit for t he 20 pin device of the zmotion tm detection and control mcu family with a single pyro electric s ensor. the interface to the pyroelectric sensor is via the dedicated input ana2 (pin 2). v ref (pin 18) must be externally tied to ana3 (pin 3). the status led is driven by pin 19 (pc3/cout) which is normally configured as a gpio by the application to control the state of the led. this pin provides a programmable constant current sink specifically for led drive without using an external resistor. pin 15 is dedicated as the debug pin and is connected to pin 4 of the debug header. pin 14 is set up for the reset function, but may also be used as pd0 (general purpose i/o) as the application requires. pull- up resistors (10k) are provided on the debug and reset signals as required for the debug interface. all other signals may be used as needed. the power supply design is left to the application needs. 10k vdd (3.3v) 1 2 3 4 5 6 vcc reset gnd dbg gnd nc debug header z8fs040xhh020eg 1 2 3 4 14 16 15 17 vdd 6 5 7 10 20 19 18 13 12 11 8 9 pb1/ana1 ana2 ana3 pa0/t0in/t0out/xin vss pa1/t0out/xout pa2/de0 pa4/rxd0 pa3/cts0 pb0/ana0 pc3/cout pc2/ana6/led/v ref pc1/ana5/cinn pc0/ana4/cinp dbg pa7/t1out pa5/txd0 reset/pd0 pa6/t1in/t1out 10k vdd (3.3v) 1uf 1uf 47k pyro electric sensor vdd gnd sig vdd (3.3v) status led vdd (3.3v) figure 11 - required circuit connections of z8fs040xhh20eg (20 pin) motion detection mcu ? single pyro mode
zmotion tm detection and control family product specification ps028506-1110 preliminary 43 dual pyroelectric sensors in dual pyro mode, the second pyroelectric sensor is connected to ana3. the signal from v ref to ana3 is not required. all other connections remain the same as single pyro mode. figure 12 - required circuit connections for z8fs040xhh20eg (20 pin) motion detection mcu ? dual pyro mode
zmotion tm detection and control family product specification ps028506-1110 preliminary 44 z8fs040xhj20eg - (28 pin) single pyroelectric sensor figure 13 shows an example circuit for t he 28 pin device of the zmotion tm detection and control mcu family with a single pyroelectric s ensor. the interface to the pyroelectric sensor is via the dedicated input ana2 (pin 1). v ref (pin 3) must be externally tied to ana3 (pin 4). the status led is driven by pin 26 (pc3/cout) which is normally configured as a gpio by the application to control the state of the led. this pin provides a programmable constant current sink specifically for led drive without using an external resistor. pin 22 is dedicated as the debug pin and is connected to pin 4 of the debug header. pin 21 is set up for the reset function, but may also be used as pd0 (general purpose i/o) as the application requires. pull- up resistors (10k) are provided on the debug and reset signals as required for the debug interface. all other signals may be used as needed. the power supply design is left to the application needs. 10k vdd (3.3v) 1 2 3 4 5 6 vcc reset gnd dbg gnd nc debug header 10k vdd (3.3v) 1uf z8fs040xhh020eg 1 2 3 4 22 24 23 25 vdd 6 5 7 10 28 27 26 21 20 19 8 9 pb1/ana1 ana2 ana3 pa0/t0in/t0out/xin vss pa1/t0out/xout pa2/de0 pa4/rxd0 pa3/cts0 pb0/ana0 pc3/cout pb5/v ref pc1/ana5/cinn pc0/ana4/cinp dbg pa7/t1out pa5/txd0 reset/pd0 pa6/t1in/t1out 11 14 12 13 18 17 16 15 pb4/ana7 avdd avss pc5 pc4 pc6 pc7 pc2/ana6 1uf 47k pyro electric sensor vdd gnd sig vdd (3.3v) status led vdd (3.3v) figure 13 - required circuit connections of z8fs040xhj20eg (28 pin) motion detection mcu ? single pyro mode
zmotion tm detection and control family product specification ps028506-1110 preliminary 45 dual pyroelectric sensors in dual pyro mode, the second pyroelectric sensor is connected to ana3. the signal from v ref to ana3 is not required. all other connections remain the same as single pyro mode. 10k vdd (3.3v) 1 2 3 4 5 6 vcc reset gnd dbg gnd nc debug header 10k vdd (3.3v) 1uf z8fs040xhh020eg 1 2 3 4 22 24 23 25 vdd 6 5 7 10 28 27 26 21 20 19 8 9 pb1/ana1 ana2 ana3 pa0/t0in/t0out/xin vss pa1/t0out/xout pa2/de0 pa4/rxd0 pa3/cts0 pb0/ana0 pc3/cout pb5/v ref pc1/ana5/cinn pc0/ana4/cinp dbg pa7/t1out pa5/txd0 reset/pd0 pa6/t1in/t1out 11 14 12 13 18 17 16 15 pb4/ana7 avdd avss pc5 pc4 pc6 pc7 pc2/ana6 1uf 47k pyro electric sensor 1 vdd gnd sig vdd (3.3v) 47k pyro electric sensor 2 vdd gnd sig vdd (3.3v) status led figure 14 - required circuit connections for z8fs040xhj20eg (28 pin) motion detection mcu ? dual pyro mode
zmotion tm detection and control family product specification ps028506-1110 preliminary 46 appendix b pir engine initialization and control description the application software must execute an initialization procedure to enable the pir engine. once the pir engine is enabled, it runs in the background from the adc interrupt. every adc conversion generates an interrupt and the pir engine performs its functions during this time. the user application code runs in the foreground and monitors the status through the api and performs any other functions required for the application. the pir engine also requires a one-second tick to perform several house-keeping operations and to keep track of its sampling rate. this needs to be provided by the user application through status/control register 1 (engine timer tick). this bit should be set to a 1-once per second by the application software to provide the engine with a 1-second time base. the accuracy of this time is not critical, but should be within +/- 10%. there are two basic modes in which the pir engine operates: normal scan rate mode and low scan rate mode. see description of the pir scan rate bit in the pir status/control register 1 for more details. the pir engine runs in the background from the adc interrupt (initiated by the application). engine processing is done during the adc interrupt. therefore cpu loading is based on the sample rate of the adc. to ensure a consistent sample rate the engine needs to know the mcu operating frequency (system clock frequency). it uses the flash frequency control registers to determine the operating frequency which must be initialized prior to starting the engine. the flash frequency high (ffreqh) and flash frequency low byte (ffreql) registers combine to form a 16-bit value ffreq primarily to control timing for flash program and erase functions. this value is also used by the pir software engine to calculate the required sample rate of the adc and other functions. the 16-bit value for ffreq is the system clock frequency in khz and is calculated using the following equation. ffreq[15:0] ? = ? {ffreqh[7:0],ffreql[7:0]} ? = ? (system ? clock ? frequency)/1000 ? basic steps for initializing the pir engine ? this process is common to both normal scan rate and low scan rate modes: 1. set up api control registers (standard and advanced) 2. initialize ffreqh and ffreql registers with mcu clock frequency 3. write pir enable pattern to pir enable register 4. call pir init 5. initialize any application specific i/o and peripherals 6. enable interrupts 7. ensure pir sensor stable bit (epir_sc0:0) is set 8. continue with application
zmotion tm detection and control family product specification ps028506-1110 preliminary 47 the following flow diagram shows the general s/w operation for normal scan rate mode. figure 15 - application flow diagram - normal scan rate execute epir_adc_isr macro monitor epir api for events reset initialize api registers recommended settings supplied in lens/pyro configuration file pir scan rate = 0 user application code set epir_enable register to epir_enable_pattern execute epir_init macro enter adc interrupt exit adc interrupt set bit 7 of epir_sc1 (engine timer tick) 1 second timer interrupt return wait for pir sensor stable epir_sc0:0=1 epir initialization adc interrupt one second timer tick main application loop initialize flash frequency register enable adc in pwrctl0 initialize oscillator & wdt set up gpio?s for application set up timer for 1 second interrupt enable global interrupts halt (optional) application initialization
zmotion tm detection and control family product specification ps028506-1110 preliminary 48 the following flow diagram shows the general s/w operation for low scan rate mode. figure 16 - software flow diagram ? low scan mode set bit 7 of epir_sc1 (engine timer tick) 5 millisecond timer interrupt return one second timer tick start next adc sample execute epir_adc_isr macro 1 second? no yes 5 millisecond adc scan monitor epir api for events reset initialize api registers recommended settings supplied in lens/pyro configuration file pir scan rate = 1 user application code set epir_enable register to epir_enable_pattern execute epir_init macro wait for pir sensor stable epir_sc0:0=1 epir initialization main application loop initialize flash frequency register enable adc in pwrctl0 initialize oscillator & wdt set up gpio?s for application set up timer for 5 millisecond interrupt enable global interrupts halt (optional) application initialization turn off adc to conserve power enter adc interrupt exit adc interrupt adc interrupt
zmotion tm detection and control family product specification ps028506-1110 preliminary 49 appendix c software support files and project configuration the following four files are provided to support the pir engine: 1. epir_api.c: contains the api register definitions and locates them at their appropriate places in memory. 2. epir_api.h: provides the bit definitions for the api registers and also contains the macro definitions for epir_init and epir_adc_isr 3. api_init_xx.h: this header file contains the default api settings specific to the lens and pyroelectric sensor being used. the application code loads the api registers with these values prior to executing the epir_init macro. several versions of this file are available from the zilog website with tested configurations s upporting the available lenses and pyroelectric sensors. refer to appendix d to select the appropriate api_init_xx file for the selected lens. 4. startupepir.asm: this is the c startup file that replaces startups.asm or startupl.asm in zds- ii. it contains the environment initialization, stack and register pointer configurations required specifically for a pir project. zds-ii project settings zilog developer studio (zds-ii) is used for s/w development. since the compiled application code has no vision into the operation of the pir engine, it is important to ensure that the application working ram area is not effected by engine operations. to facilitate this, the pir engine uses working register group e (addresses e0h to efh) as its working ram area and the application code uses working register group 0 (as defined in startupep ir.asm). these operations are automatically handled by the compiler and examples are provided with the available sample projects. the small memory model must be used for the application s/w. to support the defined memory map, zds-ii project settings must be configured as follows (sample projects are available that have these settings already configured). application project settings (small model) ? rdata: 20h-6fh, f0h-ffh o defined in zds-ii project settings under linker address spaces o this allows for 16 bytes of stack space starting at 7fh. if more space is needed, reduce the 6fh value. o the compiler uses address 00h to 0fh for working registers o address range 10h to 1fh is the working register group reserved for first level interrupt o if more than 1 level of interrupt nesting is needed by the application, the 20h must be increased by 10h for every additional nesting level.
zmotion tm detection and control family product specification ps028506-1110 preliminary 50 o address range f0h to ffh contains the advanced api registers ? edata: 100h-10fh, 110h-18fh o defined in zds-ii project settings under linker address spaces o address range 100h to 10fh contains the standard api registers ? sp = 80h o defined in startupepir.asm o first stack location is 7fh and it grows down ? rp = 00h o defined in startupepir.asm o the application code uses working register group 0 ? __intrp = 10h o defined in startupepir.asm o first level interrupt uses working register group 1 ? engine rp = e0h o this is the working register group used by the pir engine o defined by the engine entry macro?s epir_init and epir_adc_isr
zmotion tm detection and control family product specification ps028506-1110 preliminary 51 appendix d use the following table to help select the lens most appropriate to your application. the configuration file listed contains the optimal api settings for that particular lens and should be included with your zmotion tm project. refer to product specification ps0286 for lens usage and details. lens selection guide manufacturer part number description typical applications configuration header file fresnel technologies aa 0.9 gi t1 animal alley array (88 o ) 35.6mm x 49.9mm flat fresnel 22.9mm focal length 25 meter range 22 equal segments corner wall mount or very high ceiling with rectangular floor pattern ? warehouse lighting (bay light) ? large area lighting control ? hvac pir_init_01.h fresnel technologies cm 0.77 gi v3 ceiling mount array (360 o ) 37mm diameter circular lens 19.6mm focal length 3.7m radius at 2.4m height 3:1 floor coverage diameter to height ratio ceiling mount for standard commercial heights ? lighting control ? hvac control ? meeting rooms pir_init_02.h fresnel technologies cm 0.77 gi v5 ceiling mount array (360 o ) 37mm diameter circular lens 19.6mm focal length 12.2m radius at 12.2m height 2:1 floor coverage diameter to height ratio high ceiling mount for commercial and industrial applications ? commercial lighting control ? commercial hvac control pir_init_03.h fresnel technologies cwm 0.5 gi v1 ceiling/wall mount array (180 o ) circular lens with 24mm x 24mm square base 14.2mm focal length board mount clip-in wall or ceiling mount for office or meeting room lighting and hvac control ? room lighting control hvac control pir_init_04.h nicera ncl-9(26) clip-on 15mm array (360 o ) clips on to pyroelectric sensor 2.25m radius at 2m height 2.1:1 floor coverage diameter to height ratio room occupancy and proximity sensing ? lighting control ? hvac control ? appliance ? kiosk/display control ? vending power management appliance ? kiosk ? power management pir_init_05.h


▲Up To Search▲   

 
Price & Availability of Z8FS040AHJ20EG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X